<?php
	require_once('db_connect.php');

	$user_id = $_POST['user_id'];
	$passwd = $_POST['passwd'];

	$sql="select *from users where id='$user_id'";
	$result=mysqli_query($conn,$sql);

	$num_match=mysqli_num_rows($result);
	if(!$num_match) {
		echo json_encode(array('status' => 1));
		exit;
	}
	
	$row=mysqli_fetch_array($result);
    $db_passwd=$row[passwd];
      
    if($passwd != $db_passwd) {
		echo json_encode(array('status' => 2));
		exit;
	}
	
	echo json_encode(array('status' => 0));
	exit;
?>